package com.hrt.manage.address.province.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hrt.bean.Province;
import com.hrt.manage.address.province.dao.ProvinceDao;
import com.hrt.manage.address.province.service.ProvinceService;
@Service
public class ProvinceServiceImpl implements ProvinceService{
	@Resource ProvinceDao provinceDao;
	@Override
	public Long totalCount() {
		return provinceDao.totalCount();
	}

	@Override
	public void deleteById(Long[] ids) throws Exception {
		List<Province> delResult = provinceDao.getByIds(ids);
		for (Province bg : delResult) {
			bg.setIsdelete(new Integer(1));
			provinceDao.updateEntity(bg);
		}
		
	}

	@Override
	public void saveProvince(Province province) throws Exception {
		provinceDao.saveEntity(province);
		
	}

	@Override
	public List queryByPage(int pageIndex, int pageSize) {
		return provinceDao.queryByPage(pageIndex, pageSize);
	}

	@Override
	public void updateProvince(Province province) {
		provinceDao.updateEntity(province);
	}

	@Override
	public Province getProvinceById(Long id) {
		return provinceDao.getById(id);
	}

}
